<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	
	<head>
		
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		
		<title>Ajax.ScriptRequest</title>

		<script type="text/javascript" src="scripts/prototype.js"></script>
		<script type="text/javascript" src="scripts/ScriptRequest.js"></script>
		<script type="text/javascript" src="scripts/ScriptRequestExtensions.js"></script>
		
		<script type="text/javascript">
			
			var Test = {
				run: function(){
					new Ajax.ScriptRequest("http://api.flickr.com/services/rest/?method=flickr.tags.getHotList&format=json&api_key=9b629a5deea5f5e9423ddab9eebca3be&jsoncallback=alert");
					
					new Ajax.DeliciousRequest("tags/aemkei", {onResponse: console.log});
					new Ajax.FlickrRequest("flickr.tags.getHotList", {onResponse: console.log});
					new Ajax.YahooImageSearch("madonna", {onResponse: console.log});
					new Ajax.YahooWebSearch("madonna", {onResponse: console.log});
					var  j = new Ajax.XmlJsonRequest("digg.com/rss/index.xml", {onResponse: console.log, path:"channel.item"});
					console.log(j);
					new Ajax.ScriptRequest("http://api.flickr.com/services/rest/", {
						parameters: {
							method:"flickr.tags.getHotList", 
							format: "json",
							api_key: "9b629a5deea5f5e9423ddab9eebca3be"
						}, 
						onResponse: this.test,
						callbackName: "jsoncallback"
					});
				},
				
				test: function(response){
					response.hottags.tag.each(function(tag){
						$("content").innerHTML += "<li>" + tag._content + "</li>";
					});
				}
			};
			
			Event.observe(window, "load", Test.run.bind(Test));			
		</script>		
		
	</head>
	
	<body>
		Flickr Hot Tags:
		<ul id="content"></ul>
	</body>
</html>
